package com.aaa.service.xg.impl;


import com.aaa.dao.xg.PlanFpaDao;

import com.aaa.pojo.PlanFpa;
import com.aaa.service.xg.PlanFpaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class PlanFpaServiceImpl implements PlanFpaService {

    @Autowired
    private PlanFpaDao planFpaDao;
    @Override
    public List<PlanFpa> findAll(String page,String limit) {
        int pageInt = Integer.parseInt(page);
       int limitInt =  Integer.parseInt(limit);
       int start = (pageInt - 1)*limitInt;
        List<PlanFpa> all =  planFpaDao.findAll(start,limitInt);
        return all;
    }

    @Override
    public int findCount() {
        int count = planFpaDao.findCount();
        return count;
    }

    @Override
    public int insert(PlanFpa planFpa) {
        int insert = planFpaDao.insert(planFpa);
        return insert;
    }

    @Override
    public int update(PlanFpa planFpa) {
        int update = planFpaDao.update(planFpa);
        return update;
    }

    @Override
    public List<PlanFpa> findByName(String testName, String createBy) {
        List<PlanFpa> planFpaList = planFpaDao.findByName(testName, createBy);
        return planFpaList;
    }

    @Override
    public int findIfCount(String testName, String createBy) {
        int ifCount = planFpaDao.findIfCount(testName, createBy);
        return ifCount;
    }

    @Override
    public int delete(List<String> idList) {
        int delete = planFpaDao.delete(idList);
        return delete;
    }
}
